{extend name="shop/showstore/common/store_layout" /}
{block name="content"}

<div class="wrapper mt10">
    <div class="ncs-sale-rule">
        <div class="left"></div>
        <div class="mjs-tit"><?php echo $mansong_info['mansong_name'];?>
            <time>( <?php echo date('Y-m-d',$mansong_info['start_time']).'--'.date('Y-m-d',$mansong_info['end_time']);?> )</time>
        </div>
        <ul class="mjs-info">
            <?php foreach($mansong_info['rules'] as $value) { ?>
            <li> <span class="sale-rule">单笔订单消费满<em>&yen;<?php echo ncPriceFormat($value['price']);?></em>
                <?php if(!empty($value['discount'])) { ?>
                ， 立减现金<em>&yen;<?php echo ncPriceFormat($value['discount']);?></em>
                <?php } ?>
                <?php if(!empty($value['goods_id'])) { ?>
                ， 还可获赠品 <a href="<?php echo $value['goods_url'];?>" title="<?php echo $value['mansong_goods_name'];?>" target="_blank"> <img src="<?php echo cthumb($value['goods_image'], 60);?>" alt="<?php echo $value['mansong_goods_name'];?>"> </a>&nbsp;。
                <?php } ?>
        </span> </li>
            <?php } ?>
        </ul>
        <div class="mjs-remark"><?php echo $mansong_info['remark'];?></div>
    </div>
    <div class="ncs-main-container">
        <div class="title">
            <h4>全部活动商品</h4>
        </div>
        <?php if(!empty($recommended_goods_list) && is_array($recommended_goods_list)){?>
        <div class="content ncs-all-goods-list mb15">
            <ul>
                <?php foreach($recommended_goods_list as $value){?>
                <li>
                    <dl>
                        <dt><a href="<?php echo url('shop/Goods/index',array('goods_id'=>$value['goods_id']));?>" class="goods-thumb" target="_blank"><img src="<?php echo thumb($value, 240);?>" alt="<?php echo $value['goods_name'];?>" /></a>
                        <ul class="goods-thumb-scroll-show">
                            <?php if (is_array($value['image'])) { array_splice($value['image'], 5);?>
                            <?php $i=0;foreach ($value['image'] as $val) {$i++?>
                            <li<?php if($i==1) {?> class="selected"<?php }?>><a href="javascript:void(0);"><img src="<?php echo thumb($val, 60);?>"/></a></li>
                            <?php }?>
                            <?php } else {?>
                            <li class="selected"><a href="javascript:void(0)"><img src="<?php echo thumb($value, 60);?>"></a></li>
                            <?php }?>
                        </ul>
                        </dt>
                        <dd class="goods-name"><a href="<?php echo urlShop('goods', 'index', array('goods_id'=>$value['goods_id']));?>" title="<?php echo $value['goods_name'];?>" target="_blank"><?php echo $value['goods_name']?></a></dd>
                        <dd class="goods-info"><span class="price">&yen; <?php echo ncPriceFormat($value['goods_promotion_price']);?> </span><span class="goods-sold">售出：<strong><?php echo $value['goods_salenum'];?></strong> 件</span></dd>
                        <?php if (sysconf('groupbuy_allow') && $value['goods_promotion_type'] == 1) {?>
                        <dd class="goods-promotion"><span>抢购商品</span></dd>
                        <?php } elseif (sysconf('promotion_allow') && $value['goods_promotion_type'] == 2)  {?>
                        <dd class="goods-promotion"><span>限时折扣</span></dd>
                        <?php }?>
                    </dl>
                </li>
                <?php }?>
            </ul>
        </div>
        <div class="pagination"><?php echo $show_page; ?></div>
        <?php }else{?>
        <div class="content ncs-all-goods-list">
            <div class="nothing">
                <p>很抱歉! 没有找到相关商品</p>
            </div>
        </div>
        <?php }?>
    </div>
</div>
<script>
    $(function(){
        // 图片切换效果
        $('.goods-thumb-scroll-show').find('a').mouseover(function(){
            $(this).parents('li:first').addClass('selected').siblings().removeClass('selected');
            var _src = $(this).find('img').attr('src');
            _src = _src.replace('_60.', '_240.');
            _src = _src.replace('-60', '-240');
            $(this).parents('dt').find('.goods-thumb').find('img').attr('src', _src);
        });
    });
</script>

{/block}